Imports RIBS.DataAccessLayer

Namespace BusinessLogicLayer
    Public Class Action

        Private _ActionID As Int32
        Private _EntryDate As DateTime
        Private _RibsID As Int32
        Private _Action As String
        Private _ContactMethod As String
        Private _Note As String
        Private _User As String
        Private _ActionDate As Date
        Private _RibsState As String
        Private _Reason As String

        Public Sub New(ByVal ActionID As Int32, _
                        ByVal EntryDate As DateTime, _
                        ByVal RibsID As Int32, _
                        ByVal Action As String, _
                        ByVal ContactMethod As String, _
                        ByVal Note As String, _
                        ByVal User As String, _
                        ByVal ActionDate As Date, _
                        ByVal RibsState As String, _
                        ByVal Reason As String)
            _ActionID = ActionID
            _EntryDate = EntryDate
            _RibsID = RibsID
            _Action = Action
            _ContactMethod = ContactMethod
            _Note = Note
            _User = User
            _ActionDate = ActionDate
            _RibsState = RibsState
            _Reason = Reason
        End Sub

        Public Property ActionID() As Int32
            Get
                If _ActionID = 0 Then
                    Return 0
                Else
                    Return _ActionID
                End If
            End Get
            Set(ByVal value As Int32)
                _ActionID = value
            End Set
        End Property

        Public Property EntryDate() As DateTime
            Get
                If Not IsDate(_EntryDate) Then
                    Return Nothing
                Else
                    Return _EntryDate
                End If
            End Get
            Set(ByVal value As DateTime)
                _EntryDate = value
            End Set
        End Property

        Public Property RibsID() As Int32
            Get
                If _RibsID = 0 Then
                    Return 0
                Else
                    Return _RibsID
                End If
            End Get
            Set(ByVal value As Int32)
                _RibsID = value
            End Set
        End Property

        Public Property Action() As String
            Get
                If _Action Is Nothing OrElse _Action.Length = 0 Then
                    Return String.Empty
                Else
                    Return _Action
                End If
            End Get
            Set(ByVal value As String)
                _Action = value
            End Set
        End Property

        Public Property ContactMethod() As String
            Get
                If _ContactMethod Is Nothing OrElse _ContactMethod.Length = 0 Then
                    Return String.Empty
                Else
                    Return _ContactMethod
                End If
            End Get
            Set(ByVal value As String)
                _ContactMethod = value
            End Set
        End Property

        Public Property Note() As String
            Get
                If _Note Is Nothing OrElse _Note.Length = 0 Then
                    Return String.Empty
                Else
                    Return _Note
                End If
            End Get
            Set(ByVal value As String)
                _Note = value
            End Set
        End Property

        Public Property User() As String
            Get
                If _User Is Nothing OrElse _User.Length = 0 Then
                    Return String.Empty
                Else
                    Return _User
                End If
            End Get
            Set(ByVal value As String)
                _User = value
            End Set
        End Property

        Public Property ActionDate() As Date
            Get
                If Not IsDate(_ActionDate) Then
                    Return Nothing
                Else
                    Return _ActionDate
                End If
            End Get
            Set(ByVal value As Date)
                _ActionDate = value
            End Set
        End Property

        Public Property RibsState() As String
            Get
                If _RibsState Is Nothing OrElse _RibsState.Length = 0 Then
                    Return String.Empty
                Else
                    Return _RibsState
                End If
            End Get
            Set(ByVal value As String)
                _RibsState = value
            End Set
        End Property

        Public Property Reason() As String
            Get
                If _Reason Is Nothing OrElse _Reason.Length = 0 Then
                    Return String.Empty
                Else
                    Return _Reason
                End If
            End Get
            Set(ByVal value As String)
                _Reason = value
            End Set
        End Property

        
    End Class
End Namespace


